package com.helei.mq.config;


import com.helei.mq.util.RabbitMqUtil;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnProperty(name = "framework.rabbitmq.enabled", havingValue = "true")
@EnableConfigurationProperties(RabbitMqProperties.class)
public class RabbitConfiguration {

//	@Autowired
//	private RabbitTemplate rabbitTemplate;
	@Autowired
	private RabbitMqProperties rabbitMqProperties;


	@Bean
	public RabbitMqUtil getJmsTemplate(RabbitTemplate jmsTemplate) {
		return new RabbitMqUtil(jmsTemplate);
	}

}
